<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript" charset="utf-8">
	var datagrid;
	$(function() {		
		datagrid = $('#datagrid').datagrid({
			url : 'memberAction!datagridTotal.html',
			title : '会员统计列表',
			iconCls : 'icon-save',
			pagination : true,
			pagePosition : 'bottom',
			pageSize : 10,
			pageList : [ 10, 20, 30, 40 ],
			fit : true,
			fitColumns : false,
			nowrap : false,
			border : false,
			idField : 'id',
			sortName : 'consume',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : true,
			frozenColumns : [ [ {
				title : '会员编号',
				field : 'serial',
				width : 110,
				sortable : true
			} ] ],
			columns : [ [  {
				title : '会员姓名',
				field : 'name',
				width : 110
			},{
				title : '开卡时间',
				field : 'openDate',
				width : 110
			}, {
				title : '会员类型',
				field : 'tname',
				width : 110
			},{
				title : '手机',
				field : 'mobile',
				width : 110
			},{
				title : '生日',
				field : 'birthdayB',
				width : 110,
				formatter : function(value, row, index) {
					return value.substring(0,10);
				}
			},{
				title : '消费金额',
				field : 'consume',
				width : 110
			},{
				title : '积分',
				field : 'point',
				width : 110
			}] ],			
			onRowContextMenu : function(e, rowIndex, rowData) {
				e.preventDefault();
				$(this).datagrid('unselectAll');
				$(this).datagrid('selectRow', rowIndex);
				$('#menu').menu('show', {
					left : e.pageX,
					top : e.pageY
				});
			}
		});
		
		var rid = $('#searchForm').find('input[name=rid]');
		var ridCombobox = rid.combobox({
			url : '${pageContext.request.contextPath}/rkgl/repertoryAction!noAuth_combobox.html',
			valueField : 'id',
			textField : 'name',
			multiple : false,
			editable : false,
			panelHeight : 'auto'
		});

	});

	
	function _search() {
		datagrid.datagrid('load', sy.serializeObject($('#searchForm')));
	}
	function cleanSearch() {
		datagrid.datagrid('load', {});
		$('#searchForm input').val('');
	}
</script>
</head>
<body class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false,title:'搜索条件'" style="height: 60px;overflow: hidden;" align="left">
		<form id="searchForm">
			<table class="tableForm datagrid-toolbar" style="width: 100%;height: 100%;">
			    <tr>
			        <!--  th style="width:60px;">所属仓库</th>
					<td style="width:16px;"><input name="rid" style="width: 110px;" /></td-->
					<th style="width:60px;">消费金额</th>
					<td style="width:220px;">&nbsp;&nbsp;<input name="consumeStart" style="width: 80px;" />&nbsp;&nbsp;至&nbsp;&nbsp;<input name="consumeEnd" style="width: 80px;" /></td>
					<th style="width:60px;">积分</th>
					<td style="width:220px;">&nbsp;&nbsp;<input name="pointStart" style="width: 80px;" />&nbsp;&nbsp;至&nbsp;&nbsp;<input name="pointEnd" style="width: 80px;" /></td>
					
					<td><a href="javascript:void(0);" class="easyui-linkbutton" onclick="_search();">查询</a><a href="javascript:void(0);" class="easyui-linkbutton" onclick="cleanSearch();">清空</a></td>
				</tr>			  
			</table>
		</form>
	</div>
	<div data-options="region:'center',border:false" style="overflow: hidden;">
		<table id="datagrid"></table>
	</div>
	
</body>
</html>